home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Blogowanie poza sfera / Flock 0.9.1.3 stable / flock-0.9.1.3.en-US.win32.exe / flock / components / flockPhotoAccount.js < prev    next >
Text File  |  2007-10-12  |  3KB  |  84 lines

  1. //
  2. // BEGIN FLOCK GPL
  3. // 
  4. // Copyright Flock Inc. 2005-2007
  5. // http://flock.com
  6. // 
  7. // This file may be used under the terms of of the
  8. // GNU General Public License Version 2 or later (the "GPL"),
  9. // http://www.gnu.org/licenses/gpl.html
  10. // 
  11. // Software distributed under the License is distributed on an "AS IS" basis,
  12. // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. // for the specific language governing rights and limitations under the
  14. // License.
  15. // 
  16. // END FLOCK GPL
  17. //
  18.  
  19. const FLOCK_PHOTO_ACCOUNT_CID = Components.ID('{de386250-c9bd-11da-a94d-0800200c9a66}');
  20. const FLOCK_PHOTO_ACCOUNT_CONTRACTID = '@flock.com/photo-account;1';
  21. const FLOCK_PHOTO_ACCOUNT_IID = Components.interfaces.flockIPhotoAccount;
  22.  
  23.  
  24. function flockPhotoAccount() {
  25. }
  26.  
  27. flockPhotoAccount.prototype= {
  28.     username: "",
  29.     maxSpace: "",
  30.     usedSpace: "",
  31.     maxFileSize: "",
  32.     usageUnits: "",
  33.     isPremium: false,
  34.  
  35.     QueryInterface: function(iid) {
  36.         if (!iid.equals(Components.interfaces.nsISupports) &&
  37.             !iid.equals(FLOCK_PHOTO_ACCOUNT_IID))
  38.             throw Components.results.NS_ERROR_NO_INTERFACE;
  39.         return this;
  40.     }
  41. };
  42.  
  43.  
  44. var flockPhotoAccountModule = {
  45.     registerSelf: function(compMgr, fileSpec, location, type) {
  46.         compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  47.         compMgr.registerFactoryLocation(FLOCK_PHOTO_ACCOUNT_CID, 
  48.                                         "flockPhotoAccount JS component", 
  49.                                         FLOCK_PHOTO_ACCOUNT_CONTRACTID, 
  50.                                         fileSpec, 
  51.                                         location,
  52.                                         type);
  53.     },
  54.  
  55.     getClassObject: function(compMgr, cid, iid) {
  56.         if (!cid.equals(FLOCK_PHOTO_ACCOUNT_CID))
  57.             throw Components.results.NS_ERROR_NO_INTERFACE;
  58.  
  59.         if (!iid.equals(Components.interfaces.nsIFactory))
  60.             throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  61.  
  62.         return flockPhotoAccountFactory;
  63.     },
  64.  
  65.     canUnload: function(compMgr) { return true; }
  66. };
  67.  
  68. var flockPhotoAccountFactory = {
  69.     createInstance: function(outer, iid) {
  70.         if (outer != null)
  71.             throw Components.results.NS_ERROR_NO_AGGREGATION;
  72.     
  73.         if (!iid.equals(FLOCK_PHOTO_ACCOUNT_IID) &&
  74.             !iid.equals(Components.interfaces.nsISupports))
  75.             throw Components.results.NS_ERROR_INVALID_ARG;
  76.  
  77.         return new flockPhotoAccount();
  78.     }
  79. }
  80.  
  81. /* module initialisation */
  82. function NSGetModule(comMgr, fileSpec) { return flockPhotoAccountModule; }
  83.  
  84.